home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / scsiDiskBoot / RCS / vmPage.s,v < prev   
Encoding:
Text File  |  1989-06-08  |  8.0 KB  |  352 lines

  1. head     1.5;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @# @;
  7.  
  8.  
  9. 1.5
  10. date     89.01.06.08.14.49;  author brent;  state Exp;
  11. branches ;
  12. next     1.4;
  13.  
  14. 1.4
  15. date     87.05.27.14.36.51;  author brent;  state Exp;
  16. branches ;
  17. next     1.3;
  18.  
  19. 1.3
  20. date     87.05.11.11.34.01;  author brent;  state Exp;
  21. branches ;
  22. next     1.2;
  23.  
  24. 1.2
  25. date     87.05.08.17.46.26;  author brent;  state Exp;
  26. branches ;
  27. next     1.1;
  28.  
  29. 1.1
  30. date     87.05.08.12.07.26;  author brent;  state Exp;
  31. branches ;
  32. next     ;
  33.  
  34.  
  35. desc
  36. @Page mapping support
  37. @
  38.  
  39.  
  40. 1.5
  41. log
  42. @New include files and constants due to source reorganization
  43. @
  44. text
  45. @|* vmPage.s -
  46. |*
  47. |*    Subroutines to access Sun virtual memory mapping hardware.
  48. |*
  49. |* Copyright (C) 1985 Regents of the University of California
  50. |* All rights reserved.
  51. |*
  52.  
  53. #include "vmSunConst.h"
  54.  
  55. #ifndef lint
  56.     .data
  57.     .asciz "$Header: vmPage.s,v 1.4 87/05/27 14:36:51 brent Exp $ SPRITE (Berkeley)"
  58.     .even
  59. #endif not lint
  60.     .text
  61.  
  62. |*
  63. |* ----------------------------------------------------------------------------
  64. |*
  65. |* VmGetPageMap --
  66. |*
  67. |*         Return the page map entry for the given virtual address.
  68. |*    It is assumed that the user context register is set to the context
  69. |*    for which the page map entry is to retrieved.
  70. |*
  71. |*    int GetPageMap(virtualAddress)
  72. |*        int virtualAddress;
  73. |*
  74. |* Results:
  75. |*     The contents of the hardware page map entry.
  76. |*
  77. |* Side effects:
  78. |*     None.
  79. |*
  80. |* ----------------------------------------------------------------------------
  81. |*
  82.  
  83.     .globl    _VmGetPageMap
  84. _VmGetPageMap:
  85.  
  86.     movc    sfc,d1            | Save source function code
  87.     movl    #VMMACH_MMU_SPACE,d0    | Get function code in a reg
  88.     movc    d0,sfc            | Set source function code
  89.  
  90.     movl    sp@@(4),d0        | Get virtual address into a register
  91.     andw    #VMMACH_PAGE_MAP_MASK,d0| Get relevant bits from address.
  92.     addl    #VMMACH_PAGE_MAP_OFF,d0    | Add in segment map offset
  93.     movl    d0,a0            | Move result into another register
  94.     movsl    a0@@,d0            | Read page map entry into the return
  95.                         | register.
  96.  
  97.     movc    d1,sfc            | Restore source function code
  98.  
  99.     rts                    | Return
  100.  
  101. |*
  102. |* ----------------------------------------------------------------------------
  103. |*
  104. |* VmSetPageMap --
  105. |*
  106. |*         Set the page map entry for the given virtual address to the value 
  107. |*      given in value.  It is assumed that the user context register is 
  108. |*    set to the context for which the page map entry is to be set.
  109. |*
  110. |*    void VmSetPageMap(virtualAddress, value)
  111. |*        int virtualAddress;
  112. |*        int value;
  113. |*
  114. |* Results:
  115. |*     None.
  116. |*
  117. |* Side effects:
  118. |*     The hardware page map entry is set.
  119. |*
  120. |* ----------------------------------------------------------------------------
  121. |*
  122.  
  123.     .globl    _VmSetPageMap
  124. _VmSetPageMap:
  125.  
  126.     movc    dfc,d1            | Save dest function code
  127.     movl    #VMMACH_MMU_SPACE,d0    | Get function code in a reg
  128.     movc    d0,dfc            | Set destination function code
  129.  
  130.     movl    sp@@(4),d0        | Get virtual address into a register
  131.     andw    #VMMACH_PAGE_MAP_MASK,d0| Mask out low bits
  132.     addl    #VMMACH_PAGE_MAP_OFF,d0    | Add in page map offset.
  133.     movl    d0,a0            | Move to another register.
  134.     movl    sp@@(8),d0        | Get page map entry into a register
  135.     movsl    d0,a0@@            | Write page map entry
  136.  
  137.     movc    d1,dfc            | Restore dest function code
  138.  
  139.     rts                    | Return
  140.  
  141. |*
  142. |* ----------------------------------------------------------------------------
  143. |*
  144. |* VmGetSegMap --
  145. |*
  146. |*         Return the segment map entry for the given virtual address.
  147. |*    It is assumed that the user context register is set to the context
  148. |*    for which the segment map entry is to retrieved.
  149. |*
  150. |*    int VmGetSegMap(virtualAddress)
  151. |*        int virtualAddress;
  152. |*
  153. |* Results:
  154. |*     The contents of the segment map entry.
  155. |*
  156. |* Side effects:
  157. |*     None.
  158. |*
  159. |* ----------------------------------------------------------------------------
  160. |*
  161.     .globl    _VmGetSegMap
  162. _VmGetSegMap:
  163.  
  164.     movc    sfc,d1            | Save source function code
  165.     movl    #VMMACH_MMU_SPACE,d0    | Get function code in a reg
  166.     movc    d0,sfc            | Set source function code
  167.  
  168.     movl    sp@@(4),d0        | Get virtual address in a register.
  169.     andw    #VMMACH_SEG_MAP_MASK,d0    | Get relevant bits.
  170.     addl    #VMMACH_SEG_MAP_OFF,d0    | Add in segment map offset
  171.     movl    d0,a0            | Move to another register.
  172.     clrl    d0            | Clear the return register.
  173.     movsb    a0@@,d0            | Read segment map entry into return
  174.                     | register.
  175.  
  176.     movc    d1,sfc            | Restore source function code
  177.  
  178.     rts                    | Return
  179.  
  180. |*
  181. |* ----------------------------------------------------------------------------
  182. |*
  183. |* VmSetSegMap --
  184. |*
  185. |*         Set the segment map entry for the given virtual address to the given 
  186. |*    value.  It is assumed that the user context register is set to the 
  187. |*    context for which the segment map entry is to be set.
  188. |*
  189. |*    void VmSetSegMap(virtualAddress, value)
  190. |*        int virtualAddress;
  191. |*        int value;
  192. |*
  193. |* Results:
  194. |*     None.
  195. |*
  196. |* Side effects:
  197. |*     Hardware segment map entry for the current user context is set.
  198. |*
  199. |* ----------------------------------------------------------------------------
  200. |*
  201. #ifdef notdef
  202.     .globl    _VmSetSegMap
  203. _VmSetSegMap:
  204.  
  205.     movc    dfc,d1            | Save dest function code
  206.     movl    #VMMACH_MMU_SPACE,d0    | Get function code in a reg
  207.     movc    d0,dfc            | Set destination function code
  208.  
  209.     movl    sp@@(4),d0        | Get access address
  210.     andw    #VMMACH_SEG_MAP_MASK,d0    | Mask out low bits
  211.     addl    #VMMACH_SEG_MAP_OFF,d0    | Bump to segment map offset
  212.     movl    d0,a0            | Move to another register.
  213.     movl    sp@@(8),d0        | Get segment map entry to write in a 
  214.                         | register.
  215.     movsb    d0,a0@@            | Write segment map entry
  216.  
  217.     movc    d1,dfc            | Restore dest function code
  218.  
  219.     rts                        | return
  220. #endif notdef
  221.  
  222. |*
  223. |* ----------------------------------------------------------------------------
  224. |*
  225. |* VmSetUserContext --
  226. |*
  227. |*         Set the user context register to be in the kernel context.
  228. |*
  229. |*    void VmSetUserContext()
  230. |*
  231. |* Results:
  232. |*     None.
  233. |*
  234. |* Side effects:
  235. |*     None.
  236. |*
  237. |* ----------------------------------------------------------------------------
  238. |*
  239.  
  240.     .globl    _VmSetUserContext
  241. _VmSetUserContext:
  242. #ifndef SUN3
  243.     movc    dfc,d1                | Save dest function code
  244.     movl    #VMMACH_MMU_SPACE,d0        | Get function code in a reg
  245.     movc    d0,dfc                | Set destination function code
  246.     movl    #VMMACH_KERN_CONTEXT,d0        | Get context value to set 
  247.                             | into a register
  248.     movsb    d0,VMMACH_USER_CONTEXT_OFF:w     | Move value into context 
  249.                             | register
  250.     movc    d1,dfc                | Restore dest function code
  251. #endif
  252.     rts                        | Return
  253.  
  254. @
  255.  
  256.  
  257. 1.4
  258. log
  259. @Added stuff for sun3's.  There are page map and segment map offsets
  260. that need to be used.
  261. @
  262. text
  263. @d13 1
  264. a13 1
  265.     .asciz "$Header: vmPage.s,v 1.3 87/05/11 11:34:01 brent Exp $ SPRITE (Berkeley)"
  266. d43 1
  267. a43 1
  268.     movl    #VM_MMU_SPACE,d0    | Get function code in a reg
  269. d47 2
  270. a48 2
  271.     andw    #VM_PAGE_MAP_MASK,d0    | Get relevant bits from address.
  272.     addl    #VM_PAGE_MAP_OFF,d0    | Add in segment map offset
  273. d83 1
  274. a83 1
  275.     movl    #VM_MMU_SPACE,d0    | Get function code in a reg
  276. d87 2
  277. a88 2
  278.     andw    #VM_PAGE_MAP_MASK,d0    | Mask out low bits
  279.     addl    #VM_PAGE_MAP_OFF,d0    | Add in page map offset.
  280. d121 1
  281. a121 1
  282.     movl    #VM_MMU_SPACE,d0    | Get function code in a reg
  283. d125 2
  284. a126 2
  285.     andw    #VM_SEG_MAP_MASK,d0    | Get relevant bits.
  286.     addl    #VM_SEG_MAP_OFF,d0    | Add in segment map offset
  287. d162 1
  288. a162 1
  289.     movl    #VM_MMU_SPACE,d0    | Get function code in a reg
  290. d166 2
  291. a167 2
  292.     andw    #VM_SEG_MAP_MASK,d0    | Mask out low bits
  293.     addl    #VM_SEG_MAP_OFF,d0    | Bump to segment map offset
  294. d200 1
  295. a200 1
  296.     movl    #VM_MMU_SPACE,d0        | Get function code in a reg
  297. d202 1
  298. a202 1
  299.     movl    #VM_KERN_CONTEXT,d0        | Get context value to set 
  300. d204 1
  301. a204 1
  302.     movsb    d0,VM_USER_CONTEXT_OFF:w     | Move value into context 
  303. @
  304.  
  305.  
  306. 1.3
  307. log
  308. @Added VmGetSegMap
  309. @
  310. text
  311. @d13 1
  312. a13 1
  313.     .asciz "$Header: vmPage.s,v 1.2 87/05/08 17:46:26 brent Exp $ SPRITE (Berkeley)"
  314. d48 1
  315. d88 1
  316. d198 1
  317. a198 1
  318.  
  319. d207 1
  320. a207 1
  321.      
  322. @
  323.  
  324.  
  325. 1.2
  326. log
  327. @Added VmSetSegMap and VmGetSegMap
  328. @
  329. text
  330. @d13 1
  331. a13 1
  332.     .asciz "$Header: vmPage.s,v 1.1 87/05/08 12:07:26 brent Exp $ SPRITE (Berkeley)"
  333. d155 1
  334. a155 1
  335.  
  336. d174 1
  337. a174 1
  338.  
  339. @
  340.  
  341.  
  342. 1.1
  343. log
  344. @Initial revision
  345. @
  346. text
  347. @d13 1
  348. a13 1
  349.     .asciz "$Header: vmSunAsm.s,v 1.10 86/05/01 22:43:19 nelson Exp $ SPRITE (Berkeley)"
  350. d94 81
  351. @
  352.